/*
 * @Author: hongbin
 * @Date: 2021-11-16 22:33:27
 * @LastEditors: hongbin
 * @LastEditTime: 2021-11-16 22:49:50
 * @Description: Mongodb 数据类型选择器
 */
import { FC, memo, ReactElement } from "react";
import { BSONType } from "../../api/types";

interface IProps {
  onChange: (value: string) => void;
}

const MongodbTypePick: FC<IProps> = ({ onChange }): ReactElement => {
  return (
    <select onChange={e => onChange(e.target.value)}>
      {Object.entries(BSONType).map(([key, value]) => (
        <option key={key}>{value}</option>
      ))}
    </select>
  );
};

export default memo(MongodbTypePick);
